#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
	FILE* file = fopen("bite","w+");
	if(file == NULL)
	{
		perror("fopen");
		exit(1);
	}
	char buffer[1024] = "linux so easy!\n";
	size_t sz = fwrite(buffer,strlen(buffer),1,file);
	if(sz != 1)
	{
		perror("fwrite");
		exit(1);
	}
	fseek(file, 0, SEEK_SET);
	char str[1024];
	size_t fr = fread(str,1,1024,file);
	if(fr == 0)
	{
		perror("fread");
		exit(1);
	}
	printf("%s",str);
	fclose(file);

	return 0;
}
